package com.example.test.策略模式;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HandelContext {

    @Autowired
    List<AddService> addServices;

    public int dohandel (int num){
        int t =0;
        for (AddService addService : addServices) {
            if (addService.getaddservice(num)) {
                t = addService.add(num);
            }
        }
        return t;
    }
}
